<!DOCTYPE html>
<html lang="zh">
	<head>
		<meta charset="UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<title>3-8 长表单布局</title>
	</head>


	<style>
		* {
			margin: 0;
			padding: 0;
			box-sizing: content-box;
		}

		#form {
			/* flex 纵向 */
			display: flex;
			flex-direction: column;

		}

		#form div {
			display: flex;
			flex-direction: row;
			align-items: flex-start;
			/* height: 30px; */
			/* 因为form 是纵向排列的，所以这样设置就可以把 div 上下隔开 */
			flex: 0 0 40px;
		}

		#form div label {
			flex: 0 0 130px;
			text-align: right;

		}

		#form div input {
			/* margin-top: 3px; */
			flex: 0 0 305px;
			height: 20px;
			padding: 3px;
			margin-left: 5px;
		}
	</style>

	<body>



		<form action="">

			<div id="form">

				<div class="input-group">
					<label for="">姓名:</label>
					<input type="text">
				</div>


				<div class="input-group">
					<label for="">请输入密码:</label>
					<input type="text">
				</div>


				<div class="input-group">
					<label for="">再次请输入密码:</label>
					<input type="text">
				</div>

			</div>

		</form>



	</body>
</html>
